import java.util.Scanner;

/** 
   This program reads information about coins and 
   prints the value of the coins.
*/
public class Coins
{
   public static void main(String[] args)
   {
      // Define constants
      final String P_TYPE = "P";
      final String N_TYPE = "N";
      final String D_TYPE = "D";
      final String Q_TYPE = "Q";

      // Read a number and type of coin 
      System.out.println("Enter number and type of coins: ");

      Scanner in = new Scanner(System.in);
      int numCoins = in.nextInt();
      String typCoin = in.next();

      // Determine and print worth of coin pile

      // Use output statements
      double value = 0.0;
      int type = 0;
      if (typCoin.equals(N_TYPE)) type = 1;
      else if (typCoin.equals(D_TYPE)) type = 2;
      else if (typCoin.equals(Q_TYPE)) type = 3;
      else if (typCoin.equals(P_TYPE)) type = 4;
      
      switch(type)
      {
         case 1 : value = (double)numCoins * 5; break;
         case 2 : value = (double)numCoins * 10; break;
         case 3 : value = (double)numCoins * 25; break;
         case 4 : value = (double)numCoins; break;
         default : break;
      }
      
      if (type != 0)
         System.out.printf("%.2f\n", value/100);

      // or
      else
         System.out.println("Error");
   }
}